package com.geely.design.pattern.structural.bridge;

/**
 * Created by geely
 * 应用实例
 * 转世投胎：灵魂（抽象）与肉体（实现）的分离，允许灵魂选择不同的肉体。
 * 墙上的开关：开关（抽象）与内部实现（实现）的分离，用户无需关心开关的内部工作机制。
 */
public class Test {
    public static void main(String[] args) {
        Bank icbcBank = new ICBCBank(new DepositAccount());
        Account icbcAccount = icbcBank.openAccount();
        icbcAccount.showAccountType();

        Bank icbcBank2 = new ICBCBank(new SavingAccount());
        Account icbcAccount2 = icbcBank2.openAccount();
        icbcAccount2.showAccountType();

        Bank abcBank = new ABCBank(new SavingAccount());
        Account abcAccount = abcBank.openAccount();
        abcAccount.showAccountType();
    }
}
